package com.gujia.designpattern.cor.util;

import com.gujia.designpattern.cor.handler.*;

public class PriceHandlerFactory {
    /**
     * 创建PriceHandler的工厂方法
     * @return
     */
    public static PriceHandler createPriceHandler() {

        PriceHandler sales = new Sales();
        PriceHandler lead = new Lead();
        PriceHandler manager = new Manager();
        PriceHandler dir = new Diretor();
        PriceHandler vp = new VicePresident();
        PriceHandler ceo = new CEO();

        sales.setSuccessor(lead);
        lead.setSuccessor(manager);
        manager.setSuccessor(dir);
        dir.setSuccessor(vp);
        vp.setSuccessor(ceo);
        return sales;

    }
}
